package net.wofly.common.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 所有方法的返回值
 * <ul>
 * 	<li>当code=0时，表示操作成功，解析T里的内容</li>
 * 	<li>当Code不等于0时，解析msg中的内容</li>
 * </ul>
 * @author lign
 * @version 1.0
 * @created 19-九月-2017 21:58:40
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReturnBean<T> {
	
	/** 
     * 200-成功 
     */  
    public final static int CODE_SUCCESS = 0 ;  
    
	private Integer code;
	private String msg;
	private T result;
	
	public ReturnBean(Integer code, String msg) {
		this.code = code;
		this.msg = msg;
	}
	
	public ReturnBean(String msg) {  
        super();  
        this.code = CODE_SUCCESS;  
        this.msg = msg;  
    }   
	
}